<%@page import="org.postgresql.util.PSQLException"%>
<%@page import="java.sql.SQLException"%>
<%@page import="java.security.NoSuchAlgorithmException"%>
<%@page import="java.io.UnsupportedEncodingException"%>
<%@page import="java.security.MessageDigest"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="classes.Conexao"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page buffer="100kb" autoFlush="false" %>
<!DOCTYPE html>
<html class=""><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <meta charset="UTF-8">
  <title>NutriWeb - Praticando alimentação saudável</title>
  
 <meta class="viewport" name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <!-- Favicon -->
  <link rel="shortcut icon" href="a_data/icone_nutriweb.ico">
  <!-- Font -->
  <link rel="stylesheet" href="arquivos_arquivos/css.css">
 <!-- Plagins CSS -->
  <link rel="stylesheet" href="arquivos_arquivos/buttons.css">
  <link rel="stylesheet" href="arquivos_arquivos/social-icons.css">
  <link rel="stylesheet" href="arquivos_arquivos/font-awesome.css">
  <link rel="stylesheet" href="arquivos_arquivos/bootstrap.css">
  <link rel="stylesheet" href="arquivos_arquivos/jslider.css">
  <link rel="stylesheet" href="arquivos_arquivos/settings.css">
  <link rel="stylesheet" href="arquivos_arquivos/jquery.css">
  <link rel="stylesheet" href="arquivos_arquivos/animate.css">
  <link rel="stylesheet" href="arquivos_arquivos/video-js.css">
  <link rel="stylesheet" href="arquivos_arquivos/morris.css">
  <link rel="stylesheet" href="arquivos_arquivos/royalslider.css">
  <link rel="stylesheet" href="arquivos_arquivos/rs-minimal-white.css">
  <link rel="stylesheet" href="arquivos_arquivos/layerslider.css">
  <link rel="stylesheet" href="arquivos_arquivos/ladda.css">
  <link rel="stylesheet" href="arquivos_arquivos/datepicker.css">
  <link rel="stylesheet" href="arquivos_arquivos/jquery_002.css">
  <!-- Theme CSS -->
  <link rel="stylesheet" href="a_data/style.css">
 <!-- Responsive CSS -->
  <link rel="stylesheet" href="a_data/responsive.css">
  <!-- Custom CSS -->
  <link rel="stylesheet" href="a_data/pages.css">
  <link rel="stylesheet" href="a_data/home-pages-customizer.css">
  <!-- IE Styles-->
  <link rel="stylesheet" href="a_data/ie.css">
  <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
	<link rel='stylesheet' href="css/ie/ie8.css">
  <![endif]-->
  <style type="text/css">
  .jqstooltip { position: absolute;left: 0px;top: 0px;visibility: hidden;background: rgb(0, 0, 0) transparent;background-color: rgba(0,0,0,0.6);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000);-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";color: white;font: 10px arial, san serif;text-align: left;white-space: nowrap;padding: 5px;border: 1px solid white;z-index: 10000;}.jqsfield { color: white;font: 10px arial, san serif;text-align: left;}</style>
  <style type="text/css">.fancybox-margin{margin-right:19px;}</style>
  <script style="" src="arquivos_arquivos/commonutilstats.js" charset="UTF-8" type="text/javascript"></script>
    </head>
<body class="fixed-header loaded fixed">
<div class="page-box">
<div class="page-box-content">

        <%
            request.setCharacterEncoding("UTF-8");
            String error_msg = "";
            int error = 0;
            if (request.getParameter("error")!=null){
                error = Integer.parseInt(request.getParameter("error").toString());
                switch (error){
                    case 1: error_msg = "Atenção, usuário existente!"; break;
                    case 2: error_msg = "Atenção, senha não confirmada!"; break;
                    case 3: error_msg = "Atenção, Login/Senha Incorretos!"; break;
                }
            }
            
            if (request.getParameter("logoff") != null && session.getAttribute("nm_email") != null) {
                session.invalidate();
                response.sendRedirect(request.getContextPath() + "/login.jsp");
                return;
            }
        %>
    
        <%  
            String SQL = null;
            SimpleDateFormat dtf = new SimpleDateFormat("dd/MM/yyyy HH:mm");
            SimpleDateFormat odtf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");    
            
            if (session.getAttribute("nm_email") != null) {
                String login = session.getAttribute("nm_email").toString();
                SQL = "SELECT nm_usuario, ic_sexo, ic_admin, cd_usuario, dt_ultimo_acesso FROM \"Operacoes\".\"USUARIO\" WHERE nm_email = '" + login + "' ";
                
                try {
                    for (Object[] reg : Conexao.getQuery(SQL)) {
                        session.setAttribute("nm_usuario", reg[0].toString());
                        session.setAttribute("ic_sexo", reg[1].toString());
                        session.setAttribute("ic_admin", reg[2].toString());
                        session.setAttribute("cd_usuario", reg[3].toString());
                        session.setAttribute("dt_ultimo_acesso", dtf.format(odtf.parse(reg[4].toString())));
                        response.sendRedirect(request.getContextPath() + "/inicio.jsp");
                        return;
                    }
                } catch (Exception e) {
                    out.println("Atenção, " + e.getLocalizedMessage());
                }
            }
        %>     
    
<header class="header header-two">
  <div class="header-wrapper">
	<div class="container">
	  <div class="row">
		<div class="col-xs-6 col-md-2 col-lg-3 logo-box">
		  <div class="logo">
			<a href="inicio.jsp">
			  <img src="a_data/nutriweb_logo.jpg" class="logo-img" alt="">
			</a>
		  </div>
		</div><!-- .logo-box -->
		
		<div class="col-xs-6 col-md-10 col-lg-9 right-box">
		  <div class="right-box-wrapper">
			
			<div class="primary">
			  <div class="navbar navbar-default" role="navigation">
				<button type="button" class="navbar-toggle btn-navbar collapsed" data-toggle="collapse" data-target=".primary .navbar-collapse">
				  <span class="text">Menu</span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				  <span class="icon-bar"></span>
				</button>
	  <nav style="height: 0px;" class="navbar-collapse collapse">
				  <ul class="nav navbar-nav navbar-center">
					<li >
					  <a href="inicio.html">Início</a>
					 </li>
					<li >
					  <a href="beber.html">Beber Água </a>
					 </li>
					
					<li >
					  <a href="treino.html">Treinar</a>
					 </li>
					<li class="parent">
					  <a href="refeicao.html">Refeições</a>
					  <ul class="sub">
						<li >
						  <a href="cafe_da_manha.html">Café da Manhã</a>
						</li>
						<li >
						  <a href="lanche_da_manha.html">Lanche da Manhã</a>
						</li>
						<li >
						  <a href="almoco.html">Almoço</a>
						</li>
						<li >
						  <a href="lanche_da_tarde.html">Lanche da tarde</a>
						</li>
						<li >
						  <a href="jantar.html">Jantar</a>
						</li>
						
					 </ul>
				    </li>	
					
					<li class="parent">
					  <a href="alimento.html">Alimentos</a>
					 <ul class="sub">
						<li >
						  <a href="cadastrar_alimento.html">Cadastrar</a>
						</li>
						<li >
						  <a href="consultar_alimento.html">Consultar</a>
						</li>
					 </ul>
				     </li>
					<li >
					 <a href="perfil.html">Perfil</a>
					 </li>
					<li >
					 <a href="sobre.html">Sobre</a>
					 </li>
					 <li class="item-danger item-bg text-danger">
					<a href="#">Sair</a>					 
					 </li>
					
				  </ul>
				</nav>
			  </div>
			</div><!-- .primary -->
		  </div>
		</div>
		
		<div class="phone-active col-sm-9 col-md-9">
		  <a href="#" class="close"><span>close</span>×</a>
		  <span class="title">Call Us</span> <strong>+1 (777) 123 45 67</strong>
		</div>
		<div class="search-active col-sm-9 col-md-9">
		  <a href="#" class="close"><span>close</span>×</a>
		  <form name="search-form" class="search-form">
			<input class="search-string form-control" placeholder="Search here" name="search-string" type="search">
			<button class="search-submit">
			  <svg xmlns="http://www.w3.org/2000/svg" xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="0 0 16 16" enable-background="new 0 0 16 16" xml:space="preserve">
				<path fill="#231F20" d="M12.001,10l-0.5,0.5l-0.79-0.79c0.806-1.021,1.29-2.308,1.29-3.71c0-3.313-2.687-6-6-6C2.687,0,0,2.687,0,6
				s2.687,6,6,6c1.402,0,2.688-0.484,3.71-1.29l0.79,0.79l-0.5,0.5l4,4l2-2L12.001,10z M6,10c-2.206,0-4-1.794-4-4s1.794-4,4-4
				s4,1.794,4,4S8.206,10,6,10z"></path>
				<image src="img/png-icons/search-icon.png" alt="" width="16" height="16" style="vertical-align: top;">
			  </image></svg>
			</button>
		  </form>
		</div>


		</div><!--.row -->
	</div>
  </div><!-- .header-wrapper -->
</header><!-- .header -->


<div class="breadcrumb-box">

 <div class="container">


   <ul class="breadcrumb">
  
   <li><a href="inicio.html">Início</a> </li>
   
	  </ul>	
  </div>
</div>
  <header class="page-header">
    <div class="container">
	  </div>	
  </header>

<div class="clearfix"></div>

<section id="main">
  <div class="container">
    <div class="row">
      <div class="content col-sm-12 col-md-12">
		<div class="row">
		  <div class="col-sm-6 col-md-6">
			<div class="box-404 bg">
			  <h1>404</h1>
			  <h2>Página não encontrada.</h2>
			</div>
		  </div>
		  <div class="col-sm-6 col-md-6">
			<h3>Ops! Página não encontrada...</h3>
			<p>A página procurada não foi encontrada. Tente o seguinte:</p>
			<ul>
			  <li><b>Atualize a página:</b>  Procure a página novamente 
			  clicando no botão Atualizar. O tempo limite pode 
			  ter-se esgotado devido a um congestionamento na 
			  Internet. </li>
			  <li><b>Verifique a ortografia:</b> Verifique se você
			  digitou o endereço da página da Web corretamente.
			  O endereço pode ter sido digitado incorretamente. </li>
			  <li><b>Acesse usando um link:</b> Se houver um link para a 
			  página desejada, tente acessá-la por meio desse link.  </li>
			  
			  </ul>
			<b>O que fazer?</b>
			<p>Não tenha medo, te ajudaremos! 
			Orientamos fazer o seguinte:</p>
			<ul>
			  <li>Volte à página anterior.</li>
			  <li>Acesse à página <a href="index.jsp">inicial</a> de 
			  nosso site ou <a href="login.jsp">entre com sua conta</a>
			  cadastrada.
			 </ul>
			<p>Se ainda assim você não conseguir ver a página 
			solicitada, entre em contato com a <a href="contato.jsp">
			equipe de assistência
			do site.
			
			</p>
			
		  </div>
		</div>
      </div>
    </div>
  </div><!-- .container -->
</section><!-- #main -->

</div><!-- .page-box-content -->
</div><!-- .page-box -->
<!-- #main -->

</div><!-- .page-box-content -->
</div><!-- .page-box -->

<footer id="footer">
  <div class="footer-top">
    <div class="container">
     <div class="row sidebar">
	 <center>
		<div class="  widget links">
		  <div class="title-block">
			<h3 class="title">Menu</h3>
		  </div>
		  <nav>
			<ul>
			  <li><a href="inicio.jsp">Início</a></li>
			  <li><a href="#">Sobre</a></li>
			</ul>
		  </nav>
        </div>  </center>
	</div>
    </div>
  </div><!-- .footer-top -->
  <div class="footer-bottom">
    <div class="container">
      <div class="row">
        <center>
		<div class="copyright ">
		  Desenvolvido em 2014 - NutriWeb
		</div>
		 </center>
        <div class=" ">
          <a href="#" class="up">
			<span class="glyphicon  ">Topo</span>
		  </a>
        </div>
      </div>
    </div>
  </div><!-- .footer-bottom -->
</footer>
<div class="clearfix"></div>

<script async="" src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/www-widgetapi.js" id="www-widgetapi-script"></script><script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/iframe_api"></script><script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_015.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/bootstrap.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jshashtable-2.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_018.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/tmpl.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_012.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/draggable-0.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_021.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_016.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_022.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_009.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_019.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_011.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_007.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_008.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_005.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/isotope.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_006.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_017.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_020.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_003.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_013.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/SmoothScroll.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/country.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/spin.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/ladda.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/masonry.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/morris.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/raphael.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/video.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/pixastic.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/livicons-1.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/greensock.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/layerslider_002.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/layerslider.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_014.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_004.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/bootstrapValidator.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/bootstrap-datepicker.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_010.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jplayer.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/jquery_002.js"></script>
<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/main.js"></script>


<script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/js" type="text/javascript"></script><script src="Accordions%20&amp;%20Toggles%20_%20Progressive%20%E2%80%94%20Responsive%20Multipurpose%20HTML%20Template_arquivos/main_002.js"></script>

</body>
</html>